const mongoose = require('mongoose')
var Schema=mongoose.Schema
var ObjectId= Schema.Types.ObjectId
var commentSchema = new Schema({
  content: String,
  user: {
    type:ObjectId,
    ref:"user"
  },
  reply: [],
  meta: {
    createAt: {
      type: Date,
      default: Date.now()
    },
    updateAt: {
      type: Date,
      default: Date.now()
    }
  }
})
var Comment=mongoose.model('comment',commentSchema)
module.exports=Comment
